package com.naiterui.ehp.bs.weixin.controller.inner;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bp.support.exception.BaseExceptionCodes;
import com.naiterui.ehp.bp.support.exception.PublicService;
import com.naiterui.ehp.bp.support.exception.ResponseVO;
import com.naiterui.ehp.bs.weixin.properties.WeixinProperties;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 微信accesstoken内部接口
 */
@Slf4j
@RestController
@RequestMapping("weixin/inner/access")
@RequiredArgsConstructor
@Api(tags = {SwaggerTag.WEIXIN + SwaggerTag.INNER_API + SwaggerTag.OTHER})
public class InnerAccessTokenController {

    private final WeixinProperties weixinProperties;

    @PostMapping("refresh")
    public ResponseVO<Void> refreshAccessToken() {
        log.info("调用刷新token接口");
//        WeChatApiUtil.refreshAccessToken(weixinProperties.getAppId(), weixinProperties.getSecret());
        return PublicService.returnResponseVO(BaseExceptionCodes.SUCCESS);
    }
}
